package com.define.commons.demo;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.ImportResource;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@SpringBootApplication
@ComponentScan(basePackages = "com.define.commons.common")
@ImportResource("classpath:config/transaction.xml")//加载事务配置
@EnableCaching	//开启缓存
public class CommonsDemoApplication {

    public static void main(String[] args) {

        SpringApplication.run(CommonsDemoApplication.class, args);
    }

    @GetMapping("1")
    public void get() {
        throw new RuntimeException("test log out to file");
    }

    @Value("${test.project:not found}")
    private String project;

    @GetMapping("project")
    String project(){
        return project;
    }
}
